package com.yueka.service.Impl;

import com.yueka.mapper.StatementMapper;
import com.yueka.pojo.entity.statement.Statement;
import com.yueka.pojo.entity.statement.Trend;
import com.yueka.service.StatementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class StatementServiceImpl implements StatementService {
    @Autowired
    private StatementMapper statementMapper;

    @Override
    @Transactional
    public Statement getStatement() {
        Statement stat = statementMapper.getStatement();
        stat.setStudentSourceCounts(statementMapper.getStudentSourceCounts());
        stat.setStudentStatusCounts(statementMapper.getStudentStatusCounts());
        stat.setCourseInstrumentCategorySums(statementMapper.getCourseInstrumentCategorySums());
        return stat;
    }

    @Override
    public List<Trend> getStudentTrend(String start, String end) {
        return statementMapper.getStudentTrend(start, end);
    }

    @Override
    public List<Trend> getRourseRecordTrend(String start, String end) {
        return statementMapper.getRourseRecordTrend(start, end);
    }
}
